package cm.xvexi03;

import java.sql.SQLOutput;
import java.util.Scanner;

public class Student  extends  Person{
      private   int no;
      private   int scoreEN;
      private   int scoreMath;
      private   int scoreCh;




      //


    public Student() {
    }

    public Student(int no, int scoreEN, int scoreMath, int scoreCh) {
        this.no = no;
        this.scoreEN = scoreEN;
        this.scoreMath = scoreMath;
        this.scoreCh = scoreCh;
    }


    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public int getScoreEN() {
        return scoreEN;
    }

    public void setScoreEN(int scoreEN) {
        this.scoreEN = scoreEN;
    }

    public int getScoreMath() {
        return scoreMath;
    }

    public void setScoreMath(int scoreMath) {
        this.scoreMath = scoreMath;
    }

    public int getScoreCh() {
        return scoreCh;
    }

    public void setScoreCh(int scoreCh) {
        this.scoreCh = scoreCh;
    }

    public void aver(){
        int result = (scoreEN + scoreMath +scoreCh)/3;
        System.out.println("三门成绩的平均分为:"+result);

    }


    public  void  max(){
//        if(scoreEN>scoreMath&&scoreEN>scoreCh){
//            System.out.println("三门成绩的最高分为英语"+scoreEN);
//        }else if(scoreMath>scoreEN&&scoreMath>scoreCh){
//            System.out.println("三门成绩的最高分为数学"+scoreMath);
//        }else {
//            System.out.println("三门成绩的最高分为语文"+scoreCh);
//        }
        int max = Math.max(scoreEN, scoreMath);
        int max1 = Math.max(max,scoreCh);
        System.out.println(max1);

    }
    public  void min(){
//        if(scoreEN<scoreMath&&scoreEN<scoreCh){
//            System.out.println("三门成绩的最低分为英语"+scoreEN);
//        }else if(scoreMath<scoreEN&&scoreMath<scoreCh){
//            System.out.println("三门成绩的最低分为数学"+scoreMath);
//        }else {
//            System.out.println("三门成绩的最低分为语文"+scoreCh);
//        }
        int min = Math .min(scoreEN,scoreMath);
        int min1 = Math.min(min,scoreCh);
        System.out.println(min1);



    }

    @Override
    public String toString() {
        return "Student{" +

                "no=" + no +
                ", scoreEN=" + scoreEN +
                ", scoreMath=" + scoreMath +
                ", scoreCh=" + scoreCh +
                '}';
    }
}
